// class Student {
//   firstName: string
//   lastName: string
//   fullName: string
//   constructor(firstName: string, lastName: string) {
//     this.firstName = firstName
//     this.lastName = lastName
//     this.fullName = this.firstName + this.lastName
//   }
// }
class Student {
  fullName: string
  // 在构造函数的参数上使用public等同于创建了同名的成员变量。
  constructor(public firstName: string, public lastName: string) {
    this.fullName = this.firstName + this.lastName
  }
}

interface IPerson {
  firstName: string
  lastName: string
}

function greeter1 (person: IPerson): string {
  return 'hello ' + person.firstName + person.lastName
}

const stu = new Student('wu', 'daxun')

greeter1(stu)